'use strict';

/* Directives */


angular.module('ender.game.directives', []).
    directive('endHideImages', function factoryFunction($location) {
        return {
            link: function (scope, iElement, iAttrs) {
                if ($location.search().hideImages)
                    iElement.addClass('hide-images');
            }
        }

    });

angular.module('ender.ui.directives', []).
    directive('endButtonBar', function () {
        return {
            restrict: 'E',
            replace: true,
            template: '<div class="buttonbar" ng-transclude></div>',
            transclude: true,
            link: function (scope, element, attrs) {
                element.on('mouseenter', 'a', function () {
                    $(this).find('.menu-image').slideDown('fast');
                });
                element.on('mouseleave', 'a', function () {
                    $(this).find('.menu-image').slideUp('fast');
                });
            }
        };
    }
);